from flask import Flask, render_template, Response, redirect, jsonify

app = Flask(__name__)


data = {
    "desc": "OK",
    "status": 1000,
    "data": {
        "wendu": "22",
        "ganmao": "各项气象条件适宜，无明显降温过程，发生感冒机率较低。",
        "forecast": [{
            "fengxiang": "南风",
            "fengli": "3-4级",
            "high": "高温 26℃",
            "type": "多云",
            "low": "低温 13℃",
            "date": "28日星期四"
        },
            {
                "fengxiang": "无持续风向",
                "fengli": "微风级",
                "high": "高温 28℃",
                "type": "多云",
                "low": "低温 15℃",
                "date": "29日星期五"
            },
            {
                "fengxiang": "无持续风向",
                "fengli": "微风级",
                "high": "高温 31℃",
                "type": "晴",
                "low": "低温 15℃",
                "date": "30日星期六"
            },
            {
                "fengxiang": "无持续风向",
                "fengli": "微风级",
                "high": "高温 29℃",
                "type": "多云",
                "low": "低温 20℃",
                "date": "1日星期天"
            },
            {
                "fengxiang": "北风",
                "fengli": "4-5级",
                "high": "高温 26℃",
                "type": "小到中雨",
                "low": "低温 13℃",
                "date": "2日星期一"
            }],
        "yesterday": {
            "fl": "微风",
            "fx": "无持续风向",
            "high": "高温 19℃",
            "type": "小雨",
            "low": "低温 12℃",
            "date": "27日星期三"
        },
        "aqi": "118",
        "city": "北京"
    }
}


@app.errorhandler(404)
def page_not_found(error):
    return render_template('404.html'), 404


@app.errorhandler(500)
def internal_server_error(error):
    return render_template('500.html'), 500


@app.route('/')
def hello():
    return render_template('home.html')



if __name__ == '__main__':
    app.run()
